
extract(xmltype(COS_STRUCTURE_XML),CONCAT(CONCAT('/tableofcontents/item[item/@identifierref="',CAST(RES_ID as VARCHAR2(20))),'"]/@title')).getStringVal() as "章节(单元)",
-- 获取带节点的值,例如：<tel>222</tel>
select extract(xmltype(e.prj_xml),'/data/project/persons/person[1]/tel').getStringVal() as title from project e where e.zh_title='白夜追逐繁星';
-- 备注如果节点表达式查询一个节点的父节点，则会将该父节点下的所有节点包含该父节点查出

select extractvalue(xmltype('<a><b>1</b><b>2</b></a>'),'/a/b') from dual;  -- 报错，报只返回一个节点值，因为在a标签下存在两个同名标签b
select extract(xmltype('<a><b>1</b><b>2</b></a>'),'/a/b/text()') from dual; -- extract+text() 解决同名节点问题，若存在重复节点会自动拼接在一起，但不使用任何拼接符号
-- 获取不带节点的值,例如：222
select extractvalue(xmltype(e.prj_xml),'/data/project/persons/person[1]/tel') as result from project e where e.zh_title='白夜追逐繁星';
select existsnode(xmltype(e.prj_xml),'/data/project/persons/person[1]/tel') as result from project e where e.zh_title='白夜追逐繁星';
select sys_dburigen(e.zh_title) as result from project e where e.zh_title='白夜追逐繁星';
select sys_xmlAgg(sys_xmlgen(e.prj_xml)) as result from project e where e.zh_title='白夜追逐繁星' or  e.zh_title='白夜追逐繁星2' ;
select xmlforest(e.zh_title as zhTitle,e.prj_no as prjNo,e.psn_code as psnCode).getStringVal() as xml from project e where e.zh_title='白夜追逐繁星';
select xmlelement(data,xmlforest(e.zh_title,e.prj_no,e.psn_code)).getStringVal() as xml from project e where e.zh_title='白夜追逐繁星';
select xmlelement(data,xmlattributes(e.prj_code as code),xmlforest(e.zh_title,e.prj_no,e.psn_code)).getStringVal() as xml from project e where e.zh_title='白夜追逐繁星';
 
select XMLCOLATTVAL(e.zh_title as zhTitle,e.prj_no as prjNo,e.psn_code as psnCode).getStringVal() as xml from project e where e.zh_title='白夜追逐繁星'
select xmlelement(data,xmlConcat(xmltype('<a>1</a>'),xmltype('<b>1</b>'))).getStringVal() as result from dual;
select e.getStringVal() as result
from table(xmlsequence(extract(xmltype('<a><b>233</b><c>666</c><d>88</d></a>'),'/a/*'))) e;